<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%String path = request.getContextPath() ;%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<%@ taglib uri="/WEB-INF/tld/ui.tld" prefix="ui" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>利润及利润分配</title>
    <jsp:include page="../../import.jsp" flush="true" />
    <style type="text/css">
        .field button {
            height: 18px;
            font-size: 10px;
        }
    </style>
</head>
<body class="iframeBody">
<div class="Wrapper">
    <div class="pageIn2layout">
        <div class="pageIn2L_side">
            <div class="sqPanel">
                <div class="sqPanel_head"></div>
                <div class="sqPanel_body">
                    <ul class="links">
                        <li id="inNav_01" data-src="<%=path%>/customer/cstbscinfo/toFilFinanceDebtDetailPage.do?cstId=${cstId}">资产负债表</li>
                        <li id="inNav_02" data-src="<%=path%>/customer/filFinancePro/toFilFinanceProDetailPage.do?cstId=${cstId}">利润及利润分配表</li>
                        <li id="inNav_03" data-src="<%=path%>/customer/filFinanceCash/toFilFinanceCashDetailPage.do?cstId=${cstId}">现金流量表</li>
                    </ul>
                </div>
            </div>
        </div>
        <div class="pageIn2L_mid">
            <input name="cstId" id="cstId" type="text" style="display: none;" value="${cstId}"/>
            <form id="formSet">
                <div class="fieldset2 clearFix">
                    <div class="caption">
                        <span class="title">报表信息</span>
                    </div>
                    <div class="table table_full">
                        <div class="table_cell labels" style="width: 300px;">
                            <div class="label_item">报表年份</div>
                            <div class="label_item">报表类型</div>
                            <div class="label_item">报表类型细分</div>
                            <div class="label_item">审计事务所名称</div>
                            <div class="label_item">审计人员名称</div>
                            <div class="label_item">审计时间</div>

                            <div class="label_item">营业收入</div>
                            <div class="label_item">营业成本</div>
                            <div class="label_item">营业税金及附加</div>
                            <div class="label_item">销售费用</div>
                            <div class="label_item">管理费用</div>
                            <div class="label_item">财务费用</div>
                            <div class="label_item">资产减值损失</div>
                            <div class="label_item">公允价值变动净收益</div>
                            <div class="label_item">投资净收益</div>
                            <div class="label_item">对联营企业和合营企业的投资收益</div>
                            <div class="label_item">营业利润</div>
                            <div class="label_item">营业外收入</div>
                            <div class="label_item">营业外支出</div>
                            <div class="label_item">非流动资产损失</div>
                            <div class="label_item">利润总额</div>
                            <div class="label_item">所得税费用</div>
                            <div class="label_item">净利润</div>
                            <div class="label_item">基本每股收益</div>
                            <div class="label_item">稀释每股收益</div>
                        </div>
                        <div class="table_cell fields formdiva">
                            <div class="field_item"><input name="belongDate" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item">
                                <select name="reporttype" data-value=" " >
                                    <option value="  " selected="selected">--请选择--</option>
                                    <c:forEach items="${reportTypeList}" var="opt">
                                        <option value="${opt.key}">${opt.value}</option>
                                    </c:forEach>
                                </select>
                                
                            </div>
                            <div class="field_item">
                                <select name="reportsubtype" data-value=" " >
                                    <option value="  " selected="selected">--请选择--</option>
                                    <c:forEach items="${reportsubTypeList}" var="opt">
                                        <option value="${opt.key}">${opt.value}</option>
                                    </c:forEach>
                                </select>
                                
                            </div>
                            <div class="field_item"><input name="auditinstitute" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="auditstaff" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="auditime" type="text" class="ui-textbox" value="" /></div>

                            <div class="field_item"><input name="mainIncome" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="mainCost" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="mainTaxes" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="mainOperCost" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="mainManFee" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="mainFinnaFee" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="devalueAssets" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="fairProfit" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="investIncome" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="investVentures" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="operProfit" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="operIncome" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="operExpenditure" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="assetsLoss" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="profitTotal" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="incomeTax" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="profitNet" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="earnShare" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="dilutEarnShare" type="text" class="ui-textbox" value="" /></div>
                        </div>
                        <div class="table_cell fields formdivb">
                            <div class="field_item"><input name="belongDate" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item">
                                <select name="reporttype" data-value=" " >
                                    <option value="  " selected="selected">--请选择--</option>
                                    <c:forEach items="${reportTypeList}" var="opt">
                                        <option value="${opt.key}">${opt.value}</option>
                                    </c:forEach>
                                </select>
                                
                            </div>
                            <div class="field_item">
                                <select name="reportsubtype" data-value=" " >
                                    <option value="  " selected="selected">--请选择--</option>
                                    <c:forEach items="${reportsubTypeList}" var="opt">
                                        <option value="${opt.key}">${opt.value}</option>
                                    </c:forEach>
                                </select>
                                
                            </div>
                            <div class="field_item"><input name="auditinstitute" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="auditstaff" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="auditime" type="text" class="ui-textbox" value="" /></div>

                            <div class="field_item"><input name="mainIncome" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="mainCost" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="mainTaxes" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="mainOperCost" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="mainManFee" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="mainFinnaFee" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="devalueAssets" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="fairProfit" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="investIncome" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="investVentures" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="operProfit" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="operIncome" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="operExpenditure" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="assetsLoss" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="profitTotal" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="incomeTax" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="profitNet" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="earnShare" type="text" class="ui-textbox" value="" /></div>
                            <div class="field_item"><input name="dilutEarnShare" type="text" class="ui-textbox" value="" /></div>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>

<script type="text/javascript">
    $(function () {
        $('.pageIn2L_side .links').pageInSideLink({currentNav: 'inNav_02'});
        $("#formSet").ligerForm({
            validate: true
        });
        isSwitch(0);
        initFormData();
        SetIframe_height();
    });
    //是否启用输入选择框(1是，0否)
    function isSwitch(type){

        if(type==0){
            $('#formSet select').each(function(){
                var ligeruiid = $(this).attr('ligeruiid');
                liger.get(ligeruiid).setDisabled();
            });
            $('#formSet .ui-textbox').each(function(){
                var ligeruiid = $(this).attr('ligeruiid');
                liger.get(ligeruiid).setDisabled(true);
            });
        }else{
            $('#formSet select').each(function(){
                var ligeruiid = $(this).attr('ligeruiid');
                liger.get(ligeruiid).setEnabled();
            });
            $('#formSet .ui-textbox').each(function(){
                var ligeruiid = $(this).attr('ligeruiid');
                liger.get(ligeruiid).setEnabled(true);
            });
        }
    }
    //初始化数据
    function initFormData(){
        var _cstid=$("#cstId").val();
        if(!_cstid){
            return;
        }
        var _url = '<%=path%>/customer/filFinancePro/selecProList.do';
        AjaxUtils.ajaxGet(_url, {cstId:_cstid}, function(msg){
            if(msg.success == 1){
                setFormData(msg.data);//设置数据


            }else{
                UIUtils.alertError(msg.info);
            }
        }, false);
    }
    //赋值
    function setFormData(data){
        if(data != undefined && data !=null && data.length!=0){
            if(data[0] != undefined && data[0]!=null){
                var forma = data[0];
                var objKeys = Object.keys(forma);
                for(var i = 0; i<objKeys.length; i++){
                    if(objKeys[i] != 'id'){
                        var ligeruiid = $(".formdiva [name="+objKeys[i]+"]").attr('ligeruiid');
                        if(ligeruiid) {
                            liger.get(ligeruiid).setValue(forma[objKeys[i]]);
                        }
                    }
                }
            }
            if(data[1] != undefined && data[1]!=null){
                var formb = data[1];
                var objKeys = Object.keys(formb);
                for(var i = 0; i<objKeys.length; i++){
                    if(objKeys[i] != 'id') {
                        var ligeruiid = $(".formdivb [name="+objKeys[i]+"]").attr('ligeruiid');
                        if(ligeruiid) {
                            liger.get(ligeruiid).setValue(formb[objKeys[i]]);
                        }
                    }
                }
            }
        }
    }
</script>
</body>
</html>